// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import 'es6-promise/auto';
import Vue from 'vue';
import axios from './httpapi';
import store from './store';
import * as types from './store/types';
import router from './router';
import devnotify from './device_notify';

import './vendor';

import './assets/css/bootstrap.min.css';
import './assets/css/AdminLTE.min.css';
import './assets/css/skins/skin-blue.min.css';
import './assets/css/font-awesome.min.css';
import './assets/css/ionicons.min.css';
import './assets/js/bootstrap.min';
import './assets/js/adminlte.min';

Vue.config.productionTip = false;
Vue.prototype.axios = axios;
Vue.use(devnotify);

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  axios,
  template: '<router-view></router-view>',
  created() {
    if (!store.getters.isTokenSync) {
      store.commit(types.TOKEN_SYNC);
      let redirect = "/general";
      this.$router.push({ path: redirect });
      this.open_notification(store.getters.email, store.getters.access_token);
    }
  }
});